package com.yundasys.lab13mybatisplus.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yundasys.lab13mybatisplus.dao.UserDao;
import com.yundasys.lab13mybatisplus.entity.User;
import com.yundasys.lab13mybatisplus.service.UserService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * (User)表服务实现类
 *
 * @author make-jiangta
 * @since 2021-12-23 13:53:08
 */
@Service("userService")
public class UserServiceImpl extends ServiceImpl<UserDao, User> implements UserService {

    //@Transactional(rollbackFor = Exception.class)
    @Override
    public void tessTransactional() {
        User user = new User();
        user.setAge(90);
        user.setEmail("jia@163.com");
        user.setName("ji");
        this.save(user);

        throw new RuntimeException("error");
    }
}
